<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>客户登记——客户管理——鑫四合珠宝管理后台</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="huyuzhu">
<!-- Le styles -->
<link href="${pageContext.request.contextPath}/css/bootstrap.css" rel="stylesheet" type="text/css">
<link href="${pageContext.request.contextPath}/css/base.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/main.css" rel="stylesheet">
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
      <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/bootstrap-affix.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery.placeholder.js"></script>
<script type="text/javascript">
function add(){
	clear();
	
	var customerName = $.trim($("#customerName").val());
	 if(customerName=="") {
		$("#CustomerNameMsg").html("客户名不能为空!");
	  	return false;
	 }else if(customerName.length<2 || customerName.length>100 ){
	  //合法长度为6-18个字符
	  $("#CustomerNameMsg").html("登录名合法长度为2-20个字符!");
		 return false;
	 }
	 
	 var orderName = $.trim($("#orderName").val());
	 if(orderName=="") {
		$("#OrderNameMsg").html("下单名不能为空!");
	  	return false;
	 }else if(orderName.length<2 || orderName.length>100 ){
	  //合法长度为6-18个字符
	  $("#OrderNameMsg").html("下单名合法长度为2-100个字符!");
		 return false;
	 }

	$("#AddForm").submit();
} 

function clear(){
	$("#CustomerNameMsg").html("");
	$("#OrderNameMsg").html("");
	$("#TelephoneMsg").html("");
	$("#QQMsg").html("");
	$("#EMailMsg").html("");
	$("#AddressMsg").html("");
	$("#LinkManMsg").html("");
	$("#IntroducerMsg").html("");
	$("#RemarkMsg").html("");
	$("#message").html("");
}
</script>
</head>
<body>
<!-- 头部 -->
<s:include value="../header.jsp"/>
<!-- 主内容区开始 -->
<div class="conBox clearfix">
   <s:include value="menu.jsp">
  	<s:param name="menuIndex" value="7"/>
  </s:include>
  <div class="mainBox">
    <h1>客户登记</h1>
    <s:form cssClass="form-horizontal" id="AddForm" action="addingCustomer">
       <s:if test="message!=null">
   		<div class="control-group error" id="message">
    		<label class="control-label" for=""></label>
    	<div class="help-inline tred">
      		<s:property value="message"/>
    	</div>
  		</div>
  	</s:if>
      <div class="control-group">
        <label class="control-label" for="ID">客户号：</label>
        <div class="controls">
          <s:textfield id="customerid" disabled="true" name="customer.customerid"/><span class="help-inline tred">*</span>
          <s:hidden name="customer.customerid"/><span class="help-inline tred">*</span>
          <span id="CustomeridMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="Name">客户名：</label>
        <div class="controls">
          <s:textfield id="customerName" name="customer.customerName"/><span class="help-inline tred">*</span>
          <span id="CustomerNameMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="orderName">下单名：</label>
        <div class="controls">
          <s:textfield id="orderName" name="customer.orderName"/><span class="help-inline tred">*</span>
          <span id="OrderNameMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="xiadanName">字印：</label>
        <div class="controls">
          <s:textfield id="sealWords" name="customer.sealWords"/><span class="help-inline tred">*</span>
          <span id="SealWordsMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="phone">联系电话：</label>
        <div class="controls">
          <s:textfield id="telephone" name="customer.telephone"/>
          <span id="TelephoneMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="QQ">QQ：</label>
        <div class="controls">
          <s:textfield id="qq" name="customer.qq"/>
          <span id="QQMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="email">电子邮箱：</label>
        <div class="controls">
          <s:textfield id="email" name="customer.email"/>
          <span id="EMailMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="dizhi">地址：</label>
        <div class="controls">
         <s:textfield id="address" name="customer.address"/>
         <span id="AddressMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="linkMan">联系人：</label>
        <div class="controls">
          <s:textfield id="linkMan" name="customer.linkMan"/>
          <span id="LinkManMsg" class="help-inline tred"></span>
        </div>
      </div>
       <div class="control-group">
        <label class="control-label" for="introducer">介绍人：</label>
        <div class="controls">
          <s:textfield id="introducer" name="customer.introducer"/>
          <span id="IntroducerMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="control-group">
        <label class="control-label" for="Description">备注：</label>
        <div class="controls">
          <s:textarea id="remark" name="customer.remark" cssClass="input-xlarge" rows="5"/>
          <span id="RemarkMsg" class="help-inline tred"></span>
        </div>
      </div>
      <div class="form-actions">
        <input type="button" class="btn btn-primary" value="保存" onclick="add();"/>
        <s:reset cssClass="btn" value="重置"/>
        <s:a action="queryCustomerList" cssClass="btn" >返回</s:a>
      </div>
    </s:form>
  </div>
</div>
<!-- 主内容区结束 --> 
<!-- 尾部 -->
<s:include value="../bottom.jsp"/>
</body>
</html>